<?php
if (! defined ( 'BASEPATH' ))
exit ( 'No direct script access allowed' );
class Products extends MX_Controller {

	function __construct() {
		parent::__construct ();

		$_SESSION ['KCFINDER'] = array ();
		$_SESSION ['KCFINDER'] ['disabled'] = false;

		$this->load->library ( 'ckeditor', array ('instanceName' => 'CKEDITOR1', 'basePath' => base_url () . "ckeditor/", 'outPut' => true ) );
		$this->load->model ( 'products_model' );
		if (!isset($this->session->userdata['language'])){
			$this->session->userdata['language']='';
			$this->session->set_userdata('data_language', '');
		}
		$this->lang->load('system', $this->session->userdata['language']);
	}

	function detail() {
		$id = ($this->uri->segment ( 3 ) == '') ? 0 : $this->uri->segment ( 3 );
		$detail = $this->products_model->getDetail ($id);

		$data ['detail'] = $detail;
		$data ['posts'] = $this->products_model->getPostList ($id);

		$data ['content'] = 'detail';
		$this->load->view ( 'front_end/index', $data );
	}

	

}